<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			 <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">查询条件</h4>
                </div>
               <div class="panel-body">
                            <form class="form-inline" action="/" method="POST">
                                <div class="form-group m-r-10">
                                    <input type="text" ng-model="queryEntity.departmentName" class="form-control"  placeholder="机构">
								</div>
								<div class="form-group m-r-10">
									<input type="text" ng-model="queryEntity.name" class="form-control"  placeholder="用户名">
								</div>
								<div class="form-group m-r-10">
									<input type="text" ng-model="queryEntity.realName" class="form-control"  placeholder="姓名">
								</div>
								<div class="form-group m-r-10">
									<input type="text" ng-model="queryEntity.email" class="form-control"  placeholder="邮箱" >
								</div>
								
								<button type="button" class="btn btn-sm btn-primary" ng-click="loadData();">查询</button>
							</form>
                 </div>
                 <div class="panel-footer" >
                        <button type="button" class="btn btn-primary btn-sm" ng-click="showAddModal();" >新建</button>
                       <!--  <button type="button" class="btn btn-primary btn-sm"  >导出</button> -->
                </div>
           </div>
			
			
			<!-- <table   bs-table-control="bsTableControl" ></table> -->
			
			<div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">用户列表</h4>
                </div>
                <div class="panel-body" >
                    <div  class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                       <div class="row">
                  
                        
                        </div>
                        
                        <div class="row">
                        
                        <div class="col-sm-12">
                        
                        <table  class="table table-striped table-bordered dataTable no-footer dtr-inline" role="grid" aria-describedby="data-table_info">
                        <thead>
                            <tr role="row">
                            <th rowspan="1" colspan="1"  >ID</th>
                            <th rowspan="1" colspan="1"  >用户名</th>
                            <th rowspan="1" colspan="1"  >姓名</th>
                            <th rowspan="1" colspan="1"  >联系电话</th>
                            <th rowspan="1" colspan="1"  >电子邮箱</th>
                            <th rowspan="1" colspan="1"  >角色</th>
                            <th rowspan="1" colspan="1"  >所属机构</th>
 <!--                            <th rowspan="1" colspan="1"  >是否锁定</th>
                            <th rowspan="1" colspan="1"  >是否过期</th> -->
                            <th rowspan="1" colspan="1"  >创建时间</th>
                            <th rowspan="1" colspan="1"  >操作</th>
                            </tr>
                        </thead>
                        <tbody>
                      
                            <tr ng-class="{odd:($index%2)==0,even:($index%2)!=0}" ng-repeat="item in items track by $index"  class="gradeA" role="row">
                                <td class="sorting_1">{{item.id}}</td>
                                 <td>{{item.name}}</td>
                                 <td>{{item.realName}}</td>
                                 <td>{{item.phone}}</td>
                                 <td>{{item.email}}</td>
                                 <td>{{item.roles}}</td>
                                 <td>{{item.departmentName}}</td>
                            <!--      <td>{{item.accountNonLockedName}}</td>
                                 <td>{{item.accountNonExpiredName}}</td> -->
                                <td>{{item.createTime}}</td>
                                <td>
                                <a href="javascript:;" class="btn btn-primary btn-xs m-r-5" ng-click="showEditModal(item);">编辑</a>
                                <a href="javascript:;" class="btn btn-danger btn-xs m-r-5" ng-click="doDelete(item);">删除</a>
                                </td>
                            </tr>
                            
                            </tbody>
                    </table>
                    </div>
                    </div>
                    <easy-ng-pagination></easy-ng-pagination>

                    </div>
                </div>
            </div>
			
  		</div>
	</div>
</div>

  
                     
<div class="modal fade" role="dialog" id="addModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" >新建</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*用户名</span>
             <input type="text" ng-model="entity.name" class="form-control" placeholder="请输入域账号" aria-describedby="sizing-addon2" >
             </div>
          </div>
         <!--  <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">微信ID</span>
             <input type="text" ng-model="entity.wechatId" class="form-control" placeholder="微信ID" aria-describedby="sizing-addon2" >
             </div>
          </div> -->
          <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*姓名</span>
             <input type="text" ng-model="entity.realName" class="form-control" placeholder="请输入中文或英文字符" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*电子邮箱</span>
             <input type="text" ng-model="entity.email" class="form-control" placeholder="电子邮箱" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
        <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">联系电话</span>
             <input type="text" ng-model="entity.phone" class="form-control" placeholder="联系电话" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
           <div class="row">
             <div class="col-md-12 input-group">
              <span class="input-group-addon" id="sizing-addon1">登录密码</span>
                <input type="password" id="password" ng-model="entity.password" class="form-control" placeholder="密码不能为空" aria-describedby="sizing-addon2" >
                <div class="popover fade top in" role="tooltip" id="newPasswordPopover" style="top: -170px; left: 247.5px; display: none;"><div class="arrow" style="left: 50%;"></div><h3 class="popover-title" style="display: none;"></h3><div class="popover-content"><p class="p1" style="color: rgb(255, 0, 0);">密码长度必须为8-12位</p><p class="p2" style="color: rgb(255, 0, 0);">密码中至少要有1个大写字母</p><p class="p3" style="color: rgb(255, 0, 0);">密码中至少要有1个小写字母</p><p class="p4" style="color: rgb(255, 0, 0);">密码中至少要有1个数字</p><p class="p5" style="color: rgb(255, 0, 0);">密码中至少要有1个特殊字符</p></div></div>
              </div>
          </div>
          <br>
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">确认密码</span>
              <input type="password" id="confirmPassword" ng-model="entity.confirmPassword" class="form-control" placeholder="确认密码不能为空" aria-describedby="sizing-addon2">
              <div class="popover fade top in" role="tooltip" id="confirmNewPasswordPopvoer" style="top: -42px; left: 213px; display: none;"><div class="arrow" style="left: 50%;"></div><h3 class="popover-title" style="display: none;"></h3><div class="popover-content" style="color:red;">确认新密码与登录密码不一致</div></div>
             </div>
          </div>  
         <!--   <br>
            <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">性别</span>
                                    <select class="form-control" ng-model="entity.gender"  >
                                     	<option value="FM" >男</option>
										<option value="M" >女</option>
										<option value="UNKNOWN" >未知</option>
									</select>
             </div>
          </div> -->
         <!--   <br>  
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon">*所属机构</span>
              <ul id="organizationTree" class="ztree" style="margin-top:0; width:160px;"></ul>
             </div>
          </div> -->
          
       <br>        
          <div class="row" >
             <div class="col-md-12 input-group">
             <span class="input-group-addon">机构</span>
             <input type="text"  ng-click="showDepartmentTree();"  ng-model="departmentName" readonly class="form-control" placeholder="机构" aria-describedby="sizing-addon2"   >
             </div>
          </div> 
          
          <div class="row" ng-show="departmentTreeShow==true" >
             <div class="col-md-offset-1 col-md-11 input-group">
              <ul id="departmentTree" class="ztree" style="margin-top:0; width:160px;"></ul>
             </div>
          </div>
            <br>
           <div class="row" >
             <div class="col-md-12 input-group">
              <span class="input-group-addon" id="sizing-addon1">*角色</span>
               <div class="checkbox" ng-repeat="item in roleList">
                <label ng-hide="{item.nameEn=='ROLE_SUPER_ADMIN'}" ><input type="checkbox"   ng-checked="isSelected(selectedRoleForAdd,item.id)" ng-click="updateSelection(selectedRoleForAdd,$event,item.id)"  value="item.id" >{{item.nameZh}}</label>
               </div>
             </div>
          </div>
                  
         </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" ng-click="save();">保存</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade" role="dialog" id="editModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" >编辑</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
         
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*用户名</span>
             <input type="text" ng-model="editEntity.name" class="form-control"  readonly="readonly" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <!-- <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">微信ID</span>
             <input type="text" ng-model="editEntity.wechatId" class="form-control" placeholder="微信ID" aria-describedby="sizing-addon2" >
             </div>
          </div> -->
          <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*姓名</span>
             <input type="text" ng-model="editEntity.realName" class="form-control" placeholder="请输入中文或英文字符" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">*电子邮箱</span>
             <input type="text" ng-model="editEntity.email" class="form-control" placeholder="电子邮箱" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
        <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">联系电话</span>
             <input type="text" ng-model="editEntity.phone" class="form-control" placeholder="联系电话" aria-describedby="sizing-addon2" >
             </div>
          </div>
          <br>
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">登录密码</span>
             <input type="password" id="editPassword" ng-model="editEntity.password" class="form-control" placeholder="不修改密码请留空" aria-describedby="sizing-addon2" data-toggle="popover" data-placement="top" data-content="请填写6-18位密码">
             <div class="popover fade top in" role="tooltip" id="editNewPasswordPopover" style="top: -170px; left: 247.5px; display: none;"><div class="arrow" style="left: 50%;"></div><h3 class="popover-title" style="display: none;"></h3><div class="popover-content"><p class="p1" style="color: rgb(255, 0, 0);">密码长度必须为8-12位</p><p class="p2" style="color: rgb(255, 0, 0);">密码中至少要有1个大写字母</p><p class="p3" style="color: rgb(255, 0, 0);">密码中至少要有1个小写字母</p><p class="p4" style="color: rgb(255, 0, 0);">密码中至少要有1个数字</p><p class="p5" style="color: rgb(255, 0, 0);">密码中至少要有1个特殊字符</p></div></div>
 
             </div>
          </div>
          <br>
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">确认密码</span>
             <input type="password" id="editConfirmPassword" ng-model="editEntity.confirmPassword" class="form-control" placeholder="不修改密码请留空" aria-describedby="sizing-addon2" data-toggle="popover" data-placement="top" data-content="确认密码必须与登录密码一致">
              <div class="popover fade top in" role="tooltip" id="editConfirmNewPasswordPopvoer" style="top: -42px; left: 213px; display: none;"><div class="arrow" style="left: 50%;"></div><h3 class="popover-title" style="display: none;"></h3><div class="popover-content" style="color:red;">确认新密码与登录密码不一致</div></div>
            </div>
          </div>  
        
             <!-- <br>
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">性别</span>
                                   <select class="form-control" ng-model="editEntity.gender" >
										<option value="FM" ng-selected="FM">男</option>
										<option value="M" ng-selected="M">女</option>
										<option value="UNKNOWN" ng-selected="UNKNOWN">未知</option>
									</select>
             </div>
          </div>-->
           <br> 
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">是否锁定</span>
            <select class="form-control" ng-model="editEntity.accountNonLocked">
              <option value="false" ng-selected="editEntity.accountNonLocked==false">是</option>
              <option value="true"  ng-selected="editEntity.accountNonLocked==true">否</option>
            </select>
             </div>
          </div>
           <br>
           <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">是否过期</span>
            <select class="form-control" ng-model="editEntity.accountNonExpired">
              <option value="false" ng-selected="editEntity.accountNonExpired==false">是</option>
              <option value="true" ng-selected="editEntity.accountNonExpired==true">否</option>
            </select>
             </div>
          </div>
          
          
       
         <br>        
          <div class="row">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" >机构</span>
             <input type="text" ng-click="showDepartmentTreeForEdit();" ng-model="editDepartmentName" readonly class="form-control"  placeholder="机构" aria-describedby="sizing-addon2"   >
             </div>
          </div>
          <div class="row" ng-show="departmentTreeForEditShow==true" >
             <div class="col-md-offset-1 col-md-11 input-group">
              <ul id="departmentTreeForEdit" class="ztree" style="margin-top:0; width:160px;"></ul>
             </div>
          </div> 
           
           <br>
           <div class="row" >
             <div class="col-md-12 input-group">
              <span class="input-group-addon" >*角色</span>
                <div class="checkbox" ng-repeat="item in roleList">
                <label ng-hide="{item.nameEn=='ROLE_SUPER_ADMIN'}" ><input type="checkbox"   ng-checked="isSelected(selectedRoleForEdit,item.id)" ng-click="updateSelection(selectedRoleForEdit,$event,item.id)"  value="item.id" >{{item.nameZh}}</label>
               </div> 
             </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
         <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
         <button type="button" class="btn btn-primary" ng-click="update();" >保存</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


<div class="modal fade" role="dialog" id="roleListModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" >请选择角色</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
          <div class="row" >
             <div class="col-md-12 input-group">
                <div class="checkbox" ng-repeat="item in roleList">
                <label ><input type="checkbox"   ng-checked="isSelected(selectedRoleForQuery,item.id)" ng-click="updateSelection(selectedRoleForQuery,$event,item.id)"  value="item.id" >{{item.nameZh}}</label>
               </div> 
             </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
          {{selectedRoleForQuery|json}}
          <button type="button" class="btn btn-primary btn-sm" ng-click="hideRoleListModal();" >确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
